﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="AddLookupColumnToListInfo.cs.cs" company="Collaboris Ltd.">
//   Copyright (c) Collaboris Ltd. All rights Reserved.
// </copyright>
// <summary>
//   Defines the AddLookupColumnToListInfo type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Collaboris.Saf.Actions.Wss.Entities
{
    using System;

    using SharePoint.Wss.Attributes;
    using SharePoint.Wss.Entities;

    [Serializable]
    [CollaborisClass(
        Title = "Add Lookup Column To List Info",
        ReleaseStatus = ReleaseStatus.Stable,
        Summary = "Defines the parameters to add a lookup column to a list.")]
    public class AddLookupColumnToListInfo : WSSEntityBase
    {
        #region Constants and Fields

        /// <summary>
        /// Site column name.
        /// </summary>
        private string sourceListFieldName;

        /// <summary>
        /// Site column name.
        /// </summary>
        private string sourceListUrl;

        private string targetListFieldName;

        private string targetListUrl;

        private bool fieldValueRequired;

        #endregion

        #region Properties

        [CollaborisProperty(
                 Summary = "Specifies the source list containing the " +
                           "source column.",
                 Title = "Source List Url",
                 Example = @"${CurrentWeb.Url}/Pages",
                 Required = true,
                 InputHint = InputHint.Url)]
        public string SourceListUrl
        {
            get
            {
                return this.sourceListUrl;
            }

            set
            {
                this.sourceListUrl = value;
            }
        }

        [CollaborisProperty(
                 Summary = "Specifies the source field (column) name.",
                 Title = "Source List Field Name",
                 Required = true,
                 Example = "Title",
                 InputHint = InputHint.SingleText)]
        public string SourceListFieldName
        {
            get
            {
                return this.sourceListFieldName;
            }

            set
            {
                this.sourceListFieldName = value;
            }
        }

        [CollaborisProperty(
                 Summary = "Specifies the target field (column) name.",
                 Title = "Target List Field Name",
                 Example = "PagesTitle",
                 Required = true,
                 InputHint = InputHint.SingleText)]
        public string TargetListFieldName
        {
            get
            {
                return targetListFieldName;
            }
            set
            {
                targetListFieldName = value;
            }
        }

        [CollaborisProperty(
                Summary = "Specifies the target list containing the " +
                          "target column.",
                Title = "Source List Url",
                Required = true,
                Example = @"${CurrentWeb.Url}/PublishingImages",
                InputHint = InputHint.Url)]
        public string TargetListUrl
        {
            get
            {
                return targetListUrl;
            }
            set
            {
                targetListUrl = value;
            }
        }

        [CollaborisProperty(
               Summary = "Specifies whether the field is required" + 
                        " when adding a new list item to the list.",
               Title = "Field Value Required",
               Example = "False",
               InputHint = InputHint.Boolean)]
        public bool FieldValueRequired
        {
            get
            {
                return fieldValueRequired;
            }
            set
            {
                fieldValueRequired = value;
            }
        }

        #endregion
    }
}